#!/bin/bash
#

docker exec vp0 peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Function":"init", "Args": ["a","100000", "b", "200000"]}' |& grep 'Deploy' &> /dev/null && \

docker exec vp0 peer chaincode invoke -n f889cf53dae89ecb8dadbba6d5f578fd0de88b55a8f3bba162d878323b520f16e68c6fe03b5bd9ed7ff8d98e96f030eb1764def3e4fda865c9e8317200508858   -c '{"Function": "invoke", "Args": ["a", "b", "1"]}' |& grep 'Successfully' &> /dev/null && \

docker exec vp0 peer chaincode query -n  f889cf53dae89ecb8dadbba6d5f578fd0de88b55a8f3bba162d878323b520f16e68c6fe03b5bd9ed7ff8d98e96f030eb1764def3e4fda865c9e8317200508858 -c '{"Function": "query", "Args": ["a"]}' |& grep 'Successfully' &> /dev/null && exit 0  #query
